<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>demo</title>
	<script type="text/javascript">
		window.onload=function(){
			
			
			
			function md(){
				var mydate=new Date();
				var wldate=new Date("2017,5,15");
				res=wldate.getTime()-mydate.getTime();
				d=Math.floor((wldate.getTime()-mydate.getTime())/1000/60/60/24);
				// d=Math.floor(res/1000/60/60/24);
				h=Math.floor(res/1000/60/60%24);
				s=Math.floor(res/1000/60%60);
				m=Math.floor(res/1000%60)
				h1=document.getElementsByClassName('a1');
				h1[0].innerHTML=d;
				h1[1].innerHTML=h;
				h1[2].innerHTML=s;
				h1[3].innerHTML=m;
			}
			setInterval(md,1000);
			b=document.getElementById('e');
			b.onclick=function(){
				location.reload()

			}
		    // document.write(b);
		}
	

	</script>
	<link rel="stylesheet" type="text/css" href="demo.css">
</head>
<body>
	<div class="main">
		<div class="top">
			<p class="w">距 离 毕 业 还 有...</p>
		</div>
		<div class="mid">
			<div class="l1 first"><a href="" class="a1">40</a><a href="" class="a2">天</a></div>
			<div class="l1"><a href="" class="a1">11</a><a href="" class="a2">小时</a></div>
			<div class="l1"><a href="" class="a1">32</a><a href="" class="a2">分</a></div>
			<div class="l1"><a href="" class="a1">15</a><a href="" class="a2">秒</a></div>

		</div>
	</div>
	<div class="b"><input type="button" id="e" value="刷新当前时间"></div>
</body>
</html>